import { createApp } from 'vue'
import './style.css'
import App from './App.vue'
import router from '@/router'
//引入element-plus
import ElementPlus,{ElMessage,ElLoading} from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/index.css'

//引入i18n
import i18n from '@/language/i18n'

//引入字体
import '@/assets/font/iconfont.css'

//引入Tool
import Tool from '@/utils/tools.js'

//引入store数据状态管理库
import {store,key} from '@/store/index'

//loading
const loading=ElLoading.service({
  lock:true,
  // text:'加载中...',
  background:'rgba(0,0,0,0)',
  fullscreen:true
})

//路由守卫
router.beforeEach((to,from,next)=>{
  console.log("路由to：",to)
  console.log("路由from：",from)
  console.log("路由next：",next)
  next()
})

// createApp(App).mount('#app')s
const app=createApp(App)
app.config.globalProperties.$message=ElMessage
app.config.globalProperties.$loading=loading
app.config.globalProperties.$tool=Tool
app.use(store,key)
app.use(router)
app.use(ElementPlus)
app.use(i18n)
app.mount('#app')